package cc.utils;

import java.io.IOException;
import java.lang.*;
import java.util.HashMap;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.ParserAdapter;
import org.xml.sax.helpers.XMLReaderFactory;

public class LanguageParser extends DefaultHandler{
	
      HashMap<String,String> hashMsg=new HashMap<String,String>();
      HashMap<String,String> hashMap=new HashMap<String,String>();
      
	 public void startDocument() throws SAXException  {
         //System.out.println("Start document ...");
     }
    
    public void startElement(String uri, String local, String raw,
                             Attributes attrs) throws SAXException {
       
       // System.out.println ("Current element = " + raw);
        String id=null, msg=null;
        
        if(raw.equals("msg")){
        	id=attrs.getValue(0);
        	msg=attrs.getValue(1);
        	
        	//System.out.println("\n\n\n" +id + " "+msg + "\n\n\n");
        	hashMsg.put(id, msg);
        }
        	
        }
   public void endDocument() throws SAXException  {
	   
	   hashMap=hashMsg;
}
    
    
    
    }
  
 
